<?php
/**
	管理员自身修改资料的模型
 */

/**
 * Form model for updating an authorization item.
 */
class EditPwdForm extends CFormModel {
	/**
	 *
	 * @var string item name.
	 */
	public $oldpwd;
	public $password;
	public $new_yes_pwd;
	
	/**
	 * Returns the attribute labels.
	 *
	 * @return array attribute labels (name=>label)
	 */
	public function attributeLabels() {
		return array (
				'oldpwd' => '旧密码',
				'password' => '新密码',
				'new_yes_pwd' => '确认密码' 
		);
	}
	
	/**
	 * Returns the validation rules for attributes.
	 *
	 * @return array validation rules.
	 */
	public function rules() {
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array (
				array (
						'password,new_yes_pwd',
						'required'
				),
				array('new_yes_pwd', 'compare', 'compareAttribute'=>'password'),
				
		);
	}
}
